package game.ui;

import java.util.Random;

public class CaptchaUtil {
    public static String captcha() {
        char[] ch = new char[52];
        for (int i=65, j=0; i<=90; i++, j++) {
            ch[j] = (char) i;
        }
        for (int i=97, j=26; i<=122; i++, j++) {
            ch[j] = (char) i;
        }
        Random random = new Random();
        String s = "";
        for (int i=0; i<4; i++) {
            s = s + ch[random.nextInt(52)];
        }
        s = s + random.nextInt(9);
        System.out.print("验证码" + s);
        return s;
    }
}
